﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        //作用域链 函数使用变量的时候 采用最近原则

        var num = 44;
        function f1() {
            var num = 4;
            function f2() {
                var num = 0;
                console.log(num);
            } f2();
        }
        f1();

    </script>
</body>
</html>